define(function(require, exports, module) {

	var $ = require('module/jquery/jquery');
	//测试
	$("a#ajaxwithentiy").click(function() {
		alert("ajaxwithentiy");
		ajaxFunction({"str" : "Hello World"}, "post", "getWithEntity");
	});

	$("a#ajaxwithentiy_get").click(function() {
		alert("getWithEntity_get");
		ajaxFunction({"str" : "Hello World"}, "get", "getWithEntity_get");
	});
	
	exports.ajaxUtil = ajaxFunction;
	//post 请求 
	function ajaxFunction(params, requestType, url) {
		$.ajax({
			url : url,
			type : requestType,
			data : params,
			dataType : "json",
			success : function(response) {
				alert(response);
			},
			error : function(response) {
				alert("请求错误");
			}
		});
	}
	;
});